import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import qiankun from 'vite-plugin-qiankun';

// https://vitejs.dev/config/
export default defineConfig({
  base: 'http://localhost:3002/',
  server: {
    port: 3002,
    cors: true,
    origin: 'http://localhost:3002'
  },
  plugins: [
    vue(),
    qiankun('aa', {
      useDevMode: true
    })
  ],
  resolve: {
    alias: {
      '@': '/src'
    }
  },
  output: {
    // 把子应用打包成 umd 库格式
    library: `aa`,
    libraryTarget: 'umd',
    jsonpFunction: `webpackJsonp_aa`
  }
})
